package com.example.framework2002;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.framework2002.storage.impl.MessageEvent;

import org.greenrobot.eventbus.EventBus;

public class MainActivity3 extends AppCompatActivity {
    private TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
        textView = (TextView) findViewById(R.id.textView);
    }

    public void onClick(View view) {
        String text = "组件间通信成功：数据同步完成";

        EventBus.getDefault().post(new MessageEvent(text));
        textView.setText(text);
        Toast.makeText(this, ""+new MessageEvent(text).getMessage(), Toast.LENGTH_SHORT).show();


    }
}